const App = require("koa")
const router = require("./router.js")
const bodyparser = require("koa-bodyparser")
// 创建koa对象
const app = new App();

// 注册bodyparser
app.use(bodyparser());

// 注册路由
app.use(router.routes()).use(router.allowedMethods());
// 设置接口
app.listen(8080,() => {
  console.log("server is running...")
})